package com.mall.inventory.server.mapper;

import com.mall.inventory.common.po.CmsPurchaseOrder;
import com.mall.inventory.common.po.CmsPurchasePlan;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Mapper
public interface InventoryMapper {


    /**
     * 进行批量添加
     * @param skuIdList
     * @return
     */
    int addCmsPurchasePlan(@Param("skuList") String[] skuIdList);

    /**
     * 添加采购单
     * @param cmsPurchaseOrder
     * @return
     */
    int addPurchaseOrder(CmsPurchaseOrder cmsPurchaseOrder);

    /**
     * 添加采购单详情表
     * @param orderId
     * @param planIdList
     * @return
     */
    int addPurchaseOrderDetail(@Param("orderId") Long orderId,@Param("list") String[] planIdList);

    /**
     * 查询要添加的采购单下的采购计划
     * @param planIdList
     * @return
     */
    List<CmsPurchasePlan> findByPlanids(@Param("planList") String[] planIdList);

    List<CmsPurchasePlan> findByShopId(Long shopId);

}
